package y23.Aug;

public class Test4 {
    public static int sqrt (int x) {
        if(x < 2){
            return x;
        }else if(x <= 4){
            return x / 2;
        }
        int mid  = 2;
        while(mid * mid <= x){
            mid++;
        }
        return mid-1;
    }

    public static void main(String[] args) {
        System.out.println(sqrt(2143195649));
        System.out.println(sqrt(2));
    }
}
